<?php

$api = app('Dingo\Api\Routing\Router');

$api->version('V1',[
    'namespace'  =>'App\Http\Controllers\Api\V1\Frontend\Report'
],function ($api){
    $api->group([
        'prefix'     => 'frontend',
        'middleware' => [
            'jwt.token'
        ]
    ],function ($api){
        $api->group([
            'prefix' => 'report'
        ],function ($api){
            //报工展示
            $api->get('index','IndexController@index')
                ->name('frontend.report.index.get');

            //审批（包含批量审批）
            $api->post('approval','IndexController@approval')
                ->name('frontend.report.approval.post');

            //审批 （流程展示）
            $api->get('approval/process','IndexController@approvalProcess')
                ->name('frontend.report.approval.process.get');

            //报工状态
            $api->get('status','IndexController@getReportStatus')
                ->name('frontend.report.status.get');

            //创建报工
            $api->post('report','IndexController@report')
                ->name('frontend.report.report.post');

            //编辑报工
            $api->put('report','IndexController@updateReport')
                ->name('frontend.report.report.put');

            //报工详情
            $api->get('report','IndexController@reportDetails')
                ->name('frontend.report.report.get');

            //删除报工
            $api->delete('report','IndexController@destroyReport')
                ->name('frontend.report.report.delete');

            //获取到项目下任务
            $api->get('task','IndexController@task')
                ->name('frontend.report.task.get');

            //获取工作类型
            $api->get('type','IndexController@type')
                ->name('frontend.report.type.get');

            //获取到项目/任务
            $api->get('project','IndexController@project')
                ->name('frontend.report.project.get');

            //获取到工作类型
            $api->get('work/type','IndexController@workType')
                ->name('frontend.report.work.type.get');

            //获取到任务类型
            $api->get('task/type','IndexController@taskType')
                ->name('frontend.report.task.type.get');
        });
    });
});
